package com.learner.pojo.course;

import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Proxy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author ice2020x
 */
@Data
@ToString
@Entity
@Table(name="course_media")
@GenericGenerator(name = "jpa-uuid", strategy = "uuid")
@EntityListeners(AuditingEntityListener.class)
public class CourseMedia implements Serializable {
    private static final long serialVersionUID = -5374982090726783610L;
    @Id
    @GeneratedValue(generator = "jpa-uuid")
    @Column(length = 32)
    private String id;

    @Column(name = "plan_id")
    private String planId;

    @Column(name = "course_id")
    private String courseId;


    private String title;
    @Column(name = "video_source_id")
    private String videoSourceId;
    @Column(name = "video_original_name")
    private String videoOriginalName;

    private Integer sort;

    @Column(name = "play_count")
    private Long playCount;

    @Column(name = "is_free")
    private Boolean free;

    private Float duration;

    private String status;

    private Long size;

    @Version
    private Long version;
    @CreatedDate
    @Column(name = "gmt_create")
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @LastModifiedDate
    @Column(name = "gmt_modified")
    private Date gmtModified;
}
